import {getAction} from '@/request/BaseRequest';

export default class {
  menuId;
  loading;

  constructor({menuId, loading}) {
    this.menuId = menuId;
    this.loading = loading;
  }

  loadMenuById() {
    return new Promise((success, err) => {
      getAction('/platwork/loadMenuById', {menuId: this.menuId}).then(data => {
        if (data.success) {
          success(data.result);
        }
      })
    });
  }

  loading() {
    this.loading.value = true
  }

  loaded() {
    this.loading.value = false
  }
}